const express = require('express');
const router = express.Router();
const {
  addCompetitor,
  getCompetitors,
  analyzeCompetitor,
  compareWithCompetitor,
  trackCompetitorKeywords
} = require('../controllers/competitorController');
const { protect } = require('../middleware/authMiddleware');

// 竞争对手管理路由
router.route('/')
  .post(protect, addCompetitor)
  .get(protect, getCompetitors);

// 竞争对手分析路由
router.get('/:id/analyze', protect, analyzeCompetitor);
router.post('/compare', protect, compareWithCompetitor);
router.post('/track-keywords', protect, trackCompetitorKeywords);

module.exports = router;